import http from '@/utils/request'

// 获取数据，渲染树形控件
export const reqGetDepartment = () => {
  return http({
    method: 'get',
    url: '/company/department'
  })
}

// 删除部门
export const reqDelDepartments = id => {
  return http({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 获取员工简单列表
export const reqGetUserSimple = () => {
  return http({
    method: 'get',
    url: '/sys/user/simple'
  })
}
// 新增部门
export const reqAddDept = data => {
  return http({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 根据id编辑部门详情
export const reqGetDeptInfoById = id => {
  return http({
    method: 'get',
    url: `/company/department/${id}`
  })
}

// 编辑
export const reqEditDept = data => {
  return http({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
